package com.kaiyiweitong.tongxing.widget;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Gravity;
import android.view.Window;
import android.view.WindowManager;

import com.kaiyiweitong.tongxing.R;


/**
 * Created by Administrator on 2017/9/13 0013.
 */

public class ChooseBankDialog extends Dialog {
    private int mScreenWidth;

    public ChooseBankDialog(Context context) {
        super(context);
        DisplayMetrics metrics = context.getResources().getDisplayMetrics();
        mScreenWidth = metrics.widthPixels;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        Window window = getWindow();
        window.getDecorView().setPadding(0, 0, 0, 0);
        WindowManager.LayoutParams params = window.getAttributes();
        params.gravity = Gravity.BOTTOM;
        params.width = mScreenWidth;
        window.setAttributes(params);
        window.setBackgroundDrawable(null);//背景透明
        setContentView(R.layout.dialog_choose_bank);
    }
}